﻿// ....................................................................................................................
//	Author: Copyright (C) 2012 Ing. Marek Hubal
//	Email: hubal@acasoftware.org
// ....................................................................................................................

using System;

namespace core
{
    /// <summary>Trieda ITabPage</summary>
    public class ITabPage : System.Windows.Forms.TabPage
    {
        public IBaseAppPanel AppPanel; // Objekt priradeneho panela
    }

    /// <summary>Trieda ITabControl</summary>
	public class ITabControl : System.Windows.Forms.TabControl
	{
        /// <summary>Konstruktor</summary>
        public ITabControl()
        {
            SetStyle(System.Windows.Forms.ControlStyles.Selectable, false);
        }

        /// <summary>Property: TabAlignment</summary>
        public int TabAlignment
        {
            get
            {
                switch (Alignment)
                {
                    case System.Windows.Forms.TabAlignment.Bottom: return 1;
                    case System.Windows.Forms.TabAlignment.Left: return 2;
                    case System.Windows.Forms.TabAlignment.Right: return 3;
                    default: return 0;
                }
            }
            set
            {
                if (value == TabAlignment) return; // Ziadna zmena?
                switch (value)
                {
                    case 1: Alignment = System.Windows.Forms.TabAlignment.Bottom; break;
                    case 2: Alignment = System.Windows.Forms.TabAlignment.Left; break;
                    case 3: Alignment = System.Windows.Forms.TabAlignment.Right; break;
                    default: Alignment = System.Windows.Forms.TabAlignment.Top; break;
                }
            }
        }
	}
}
